#include <iostream>
using namespace std;

//继承中的构造和析构顺序
class Base
{
public:
    Base()
    {
        cout << "Base 构造函数！" << endl;
    }

    ~Base()
    {
        cout << "Base 析构函数！" << endl;
    }
};

class Son:public Base
{
public:
    Son()
    {
        cout << "Son 构造函数！" << endl;
    }

    ~Son()
    {
        cout << "Son 析构函数！" << endl;
    }
};

void test1()
{
    Son s;
    //继承中的构造和析构顺序如下：
    //先构造父类，再构造子类
    //析构顺序则相反
}

int main()
{
    test1();
    return 0;
}